/**
 *
 */
package com.whosly.api.exception.runtime;

import com.whosly.api.exception.ILangException;
import com.whosly.api.enums.IResultCodeType;

import lombok.Getter;
import lombok.Setter;

/**
 * 不支持的操作
 *
 * @author yueny09 <deep_blue_yang@163.com>
 *
 * @DATE 2016年6月26日 上午10:53:09
 *
 */
public class UnsupportedHandleException extends IllegalArgumentException implements ILangException {
	/**
	 *
	 */
	private static final long serialVersionUID = -6179836134965230280L;

	/**
	 * 错误码
	 */
	@Getter
	@Setter
	private String errorCode;
	/**
	 * 错误描述
	 */
	@Getter
	@Setter
	private String errorMsg;
	/**
	 * 操作名称
	 */
	@Getter
	@Setter
	private String handleName;

	/**
	 * Constructs an instance of this class.
	 *
	 * @param handleName
	 *            The name of the unsupported handle
	 * @param errorType
	 *            result code type
	 */
	public UnsupportedHandleException(final String handleName, final IResultCodeType errorType) {
		super(String.valueOf(handleName) + ":" + errorType.getMessage());
		this.handleName = handleName;
		this.errorCode = errorType.getCode();
		this.errorMsg = errorType.getMessage();
	}

}
